﻿using Beetle;
using System;
using System.Collections.Generic;

internal class Class_z : IByteConverterFactory
{
    private Stack<IByteConverter> _field_a;

    public void Clear()
    {
        lock (this)
        {
            if (this._field_a != null)
            {
                this._field_a.Clear();
            }
        }
    }

    public void Init(int count)
    {
        this._field_a = new Stack<IByteConverter>(count);
        for (int i = 0; i < count; i++)
        {
            this._field_a.Push(new Class_w());
        }
    }

    public IByteConverter Pop()
    {
        lock (this)
        {
            if (this._field_a.Count > 0)
            {
                return this._field_a.Pop();
            }
            return new Class_w();
        }
    }

    public void Push(IByteConverter converter)
    {
        lock (this)
        {
            this._field_a.Push(converter);
        }
    }
}

